package com.wondream.jenkins.event;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author wangjun
 * @note JenkinsBaseEventListener
 * @date 2025-01-03  17:27
 */
public class JenkinsBaseEventListener implements InitializingBean {

    protected String eventType;

    @Override
    public void afterPropertiesSet() throws Exception {
        eventType = JenkinsEventTypeEnum.COMMON.getType();
    }

    public boolean match(JenkinsEvent event) {
        return StringUtils.equalsIgnoreCase(event.getEventType(), this.eventType);
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }
}
